import request from '@/config/axios'

// 项目 VO
export interface ProjectVO {
  id: number // 编号
  name: string // 项目名称
  remark: string // 描述
}

// 项目 API
export const ProjectApi = {
  // 查询项目分页
  getProjectPage: async (params: any) => {
    return await request.get({ url: `/agent/project/page`, params })
  },

  // 查询项目详情
  getProject: async (id: number) => {
    return await request.get({ url: `/agent/project/get?id=` + id })
  },

  // 新增项目
  createProject: async (data: ProjectVO) => {
    return await request.post({ url: `/agent/project/create`, data })
  },

  // 修改项目
  updateProject: async (data: ProjectVO) => {
    return await request.put({ url: `/agent/project/update`, data })
  },

  // 删除项目
  deleteProject: async (id: number) => {
    return await request.delete({ url: `/agent/project/delete?id=` + id })
  },

  // 导出项目 Excel
  exportProject: async (params) => {
    return await request.download({ url: `/agent/project/export-excel`, params })
  },
  
  // 生成功能设计文件
  generateDesignFile: async (id: number) => {
    return await request.post({ url: `/agent/project/generate-design-file?id=` + id })
  },
}
